//
//  DKReachabilityManager.h
//  Whistle
//
//  Created by ZhangAo on 15/7/31.
//  Copyright (c) 2015年 BookSir. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DKBaseManager.h"
#import "DKNetworkInfoModel.h"

#define GetReachabilityManager()        ([DKReachabilityManager sharedInstance])

@protocol DKReachabilityManagerObserver <NSObject>

- (void)reachabilityNetworkStatusChanged;

@end

////////////////////////////////////////////////////////////////////////

@interface DKReachabilityManager : DKBaseManager

@property (nonatomic, readonly) BOOL isReachable;
@property (nonatomic, readonly) BOOL isReachableViaWiFi;	// 通过 WiFi 连接
@property (nonatomic, readonly) BOOL isReachableViaWWAN;	// 通过移动网络连接

@property (nonatomic, readonly) NSString *networkTypeString;

// 判断是否是慢速网络，比如 2G
- (BOOL)isSlowlyNetworking;

// 获取 WiFi 信息
- (DKNetworkInfoModel *)fetchWiFiInfo;

// 异步获取当前 reach 状态
- (void)asyncFetchReachableState:(void (^)(BOOL isReachable))block;

@end
